package com.tenton.controller;

import com.tenton.service.KafkaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author：TangDong
 * @Date：2022/3/29
 * @Description：
 */
@RequestMapping("/kafka")
@Controller
public class KafkaController {
    @Autowired
    private KafkaService kafkaService;
    
    @GetMapping("/send")
    @ResponseBody
    @Transactional(rollbackFor = Exception.class)
    public void send(){
        kafkaService.send();
    }
}
